package com.qrxs.os.data.repository

import com.base.core.BaseModuleRepository
import com.lib.base.data.xsos.UserEntity
import com.lib.base.utils.MyMD5
import com.lib.net.ApiEngine
import com.lib.net.ObservableService
import com.qrxs.os.data.ApiLogin
import io.reactivex.Observable

object LoginRepository : BaseModuleRepository() {

    fun login(
        loginName: String,
        password: String,
        equName: String,
        loginIp: String,
        equVersion: String,
        equImei: String
    ): Observable<UserEntity> {
        return ObservableService.setObservable(
            ApiEngine.createService(ApiLogin::class.java).login(
                loginName,
                MyMD5.encode(password).toUpperCase(),
                equName,
                loginIp,
                equVersion,
                equImei
            )
        )
    }

}